package com.zlzkj.app.service;

import java.util.List;
import java.util.Map;
//import java.util.HashMap;

//import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

//import com.zlzkj.core.mybatis.SqlRunner;
import com.zlzkj.core.sql.Row;
//import com.zlzkj.core.sql.SQLBuilder;
//import com.zlzkj.core.util.Fn;
import com.zlzkj.app.mapper.EnergytypeMapper;
import com.zlzkj.app.model.Energytype;
//import com.zlzkj.app.util.IDGenerator;
//import com.zlzkj.app.util.Md5Util;
import com.zlzkj.app.util.Page;

@Service
@Transactional
public class EnergytypeService {
    @Value("${PAGE_SIZE}")
    private int PAGE_SIZE;

    @Autowired
    private EnergytypeMapper mapper;

//	@Autowired
//	private SqlRunner sqlRunner;

    public List<Row> findByMap(Map<String,Object> map){
        return mapper.selectByMap(map);
    }

    public List<Energytype> findName(String name) {
        return mapper.selectName(name);
    }

    public Energytype findById(String id) {
        return mapper.selectByPrimaryKey(id);
    }

    public Page findByMap(Map<String,Object> parmMap,Integer nowPage){
        if(nowPage == null) nowPage = 0;
        return new Page(findByMap(parmMap),mapper.countByMap(parmMap),nowPage,PAGE_SIZE);
    }

}
